<template>
  <div class="app-container">
    <el-row class="app-table-head">{{ $route.query.username }} 交易详情</el-row>
    <el-table v-loading="listLoading" :data="datas" :empty-text="empty_text" element-loading-text="Loading">
      <!-- <el-table-column type="selection" width="50"></el-table-column> -->
      <el-table-column label="序号" align="center" width="50">
        <template slot-scope="scope">
          {{ scope.$index + 1 }}
        </template>
      </el-table-column>
      <el-table-column label="商品名称">
        <template slot-scope="scope">
          {{ scope.row.commodityName }}
        </template>
      </el-table-column>
      <el-table-column label="服务方式">
        <template slot-scope="scope">
          <template v-if="scope.row.beOverdue == 1">
            免费
          </template>
          <template v-else-if="scope.row.beOverdue == 2">
            包月
          </template>
          <template v-else-if="scope.row.beOverdue == 3">
            包年
          </template>
        </template>
      </el-table-column>
      <el-table-column label="单价" prop="price">
        <template slot-scope="scope">
          {{ scope.row.price }}
        </template>
      </el-table-column>
      <el-table-column label="数量" prop="payCount">
        <template slot-scope="scope">
          {{ scope.row.payCount }}
        </template>
      </el-table-column>
      <el-table-column label="金额" prop="price">
        <template slot-scope="scope">
          {{ scope.row.amount }}
        </template>
      </el-table-column>
      <el-table-column align="center" prop="created_at" label="时间" width="200">
        <template slot-scope="scope">
          <i class="el-icon-time" />
          <span>{{ scope.row.payTime }}</span>
        </template>
      </el-table-column>
    </el-table>
    <div class="app-statistic">
      <el-row>
        <el-col :span="24">
          合计：&yen;
          <span class="el-price">{{priceTotal}}</span>
          元
        </el-col>
      </el-row>
    </div>
    <el-pagination
      layout="total, sizes, prev, pager, next, jumper"
      :page-size="listPages.size"
      :current-page="listPages.page"
      :total="listPages.total"
      :page-sizes="listPages.sizes"
      @size-change="_page_size_change"
      @prev-click="_page_prev_click"
      @current-change="_page_current_change"
      @next-click="_page_next_click"
    ></el-pagination>
  </div>
</template>
<script src="./index.js"></script>
<style lang="scss" src="./index.scss"></style>
<style lang="scss" scoped src="./index.scoped.scss"></style>
